<?php


namespace app\common\model;


class Jingyouquan extends Base
{
    public function user(){
        return $this->hasOne(User::class,"id","user_id");
    }

    public static function getList($page=1,$pageSize=10,$keyword=""){
        $res = [];
        $where=[];
        if($keyword){
            $where[] = array("content","like","%".$keyword."%");
        }
        //获取排序
        $order_by = input("order_by","sort_time desc,create_time desc");
        //$count = self::where($where)->count();
        $list = self::where($where)->with(['user'])->order($order_by)->page($page, $pageSize)->paginate($pageSize);

        return returnFormat(0,'查询成功',$list);
    }

}
